fix(build): normalize Windows backslash paths for sourcemap resolution#714
fix(build): normalize Windows backslash paths for sourcemap resolution#714
Conversation
On Windows, Bun resolves Error.stack frame paths with backslashes (e.g., "dist-bin\bin.js"). The beforeSend hook prepended "/" but did not convert backslashes to forward slashes, producing "/dist-bin\bin.js" which never matched the uploaded artifact at "~/dist-bin/bin.js". Also normalizes the sourcemap sources array in debug ID injection so bundlers on Windows produce consistent forward-slash paths regardless of build platform.
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
|
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1575 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 95.37% 95.36% -0.01%
==========================================
Files 232 232 —
Lines 33927 33928 +1
Branches 0 0 —
==========================================
+ Hits 32354 32353 -1
- Misses 1573 1575 +2
- Partials 0 0 —Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3f872f9. Configure here.
…ger regeneration generate-skill.ts reads the version from package.json and embeds it in skill file frontmatter. Without package.json in the paths-filter, version bump commits (which only touch package.json + plugin.json) skip the check-generated job entirely, leaving skill files stale.
Source Map v3 spec allows null entries in the sources array. Without a guard, replaceAll() on null throws TypeError. Added null check and a test case for this edge case.

Summary
\) to forward slashes (/) in the telemetrybeforeSendhook so frame paths match uploaded sourcemap artifact URLssourcesarray during debug ID injection so bundlers on Windows produce consistent pathsFixes https://sentry.sentry.io/issues/7402821077/
Problem
On Windows, Bun compiled binaries resolve
Error.stackframe paths with backslashes (e.g.,dist-bin\bin.js). TheensureAbsolute()function intelemetry.tsprepended/but didn't convert backslashes, producing/dist-bin\bin.js. The Sentry symbolicator couldn't match this to the uploaded artifact at~/dist-bin/bin.js, so sourcemaps were never applied — stack traces showed minified function names likeutwith no source context.Changes
src/lib/telemetry.ts: Add.replaceAll("\\", "/")inensureAbsolute()before the relative-path check. Coversframe.filename,frame.abs_path, anddebug_meta.images[].code_file.src/lib/sourcemap/debug-id.ts: Normalizesourcesarray to forward slashes after parsing the sourcemap JSON. Benefits both the CLI's own build and user-facingsentry sourcemap inject.test/script/debug-id.test.ts: Two new test cases for backslash normalization insourcesand forward-slash preservation.